package com.it.controller;

import com.it.domain.ResponseResult;
import com.it.domain.dto.LinkDTO;
import com.it.service.LinkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/link")
public class LinkController {

    @Autowired
    private LinkService linkService;

    /**
     * 获取所有友链
     * @return
     */
    @GetMapping("/list")
    public ResponseResult getAllLink() {
        return linkService.getAllLink();
    }

    /**
     * 申请友链
     * @param linkDTO
     * @return
     */
    @PostMapping("/auth/apply")
    public ResponseResult applyLink(@RequestBody LinkDTO linkDTO) {
        return linkService.applyLink(linkDTO);
    }
}
